#pragma once
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <png.h>

using namespace std;
#define PNG_BYTES_TO_CHECK 8
#define HAVE_ALPHA 1
#define NOT_HAVE_ALPHA 0

namespace android {
    typedef struct _pic_data pic_data;
    struct _pic_data
    {
        int width, height;   //长宽
        int bit_depth;       //位深度
        int alpha_flag;      //是否有透明通道
        int channel;
        unsigned char *rgba; //实际rgb数据
    };
    extern int decode_png(const char *filename, pic_data *out);
    extern int check_is_png(FILE **fp, const char *filename);
    extern int RotationRight90(unsigned char *src, int srcW, int srcH, int channel);
    extern int write_png_file(const char *filename, pic_data *out);
} //namespace